import { useReducer } from "react"

/**
 * 强制组件重新渲染
 * @returns 渲染更新函数
 */
const useUpdate = () => {
  const [, update] = useReducer((x: number) => x + 1, 0)

  return update
}

export default useUpdate
